package com.kuang.bascic.utils;

import lombok.Data;

@Data
public class AjaxResult {

    private Boolean success= true;
    private String message ="操作成功";
    // 返回一些额外的数据到前台
    private Object resultObj = null;

    // 成功的调用
    public AjaxResult(){

    }

    // 失败的调用
    public AjaxResult(String message){
        this.message=message;
        this.success=false;
    }
    // 不需要 new
    public static AjaxResult me(){
        return new AjaxResult();
    }
    // 链式编程
    public AjaxResult setSuccess(Boolean success){
        this.success=success;
        return this;
    }
    // 链式编程  设置完了把自己返回继续设置
    public AjaxResult setMessage(String message){
        this.message = message;
        this.success=false;
        return this;

    }
    public AjaxResult setResultObj(Object resultObj){
        this.resultObj=resultObj;
        return this;
    }



























}
